<?php

namespace backend\modules\wxsource\models;

use Yii;

/**
 * This is the model class for table "wx_source".
 *
 * @property string $media_id
 * @property string $title
 * @property string $author
 * @property string $digest
 * @property string $content
 * @property string $content_source_url
 * @property string $thumb_media_id
 * @property integer $show_cover_pic
 * @property string $url
 * @property string $thumb_url
 * @property integer $need_open_comment
 * @property integer $only_fans_can_comment
 * @property integer $create_time
 * @property integer $update_time
 */
class WxSource extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'wx_source';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['media_id'], 'required'],
            [['content'], 'string'],
            [['show_cover_pic', 'need_open_comment', 'only_fans_can_comment', 'create_time', 'update_time'], 'integer'],
            [['media_id', 'thumb_media_id'], 'string', 'max' => 45],
            [['title', 'digest', 'content_source_url', 'url', 'thumb_url'], 'string', 'max' => 600],
            [['author'], 'string', 'max' => 60],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'media_id' => Yii::t('app', 'Media ID'),
            'title' => Yii::t('app', 'Title'),
            'author' => Yii::t('app', 'Author'),
            'digest' => Yii::t('app', 'Digest'),
            'content' => Yii::t('app', 'Content'),
            'content_source_url' => Yii::t('app', 'Content Source Url'),
            'thumb_media_id' => Yii::t('app', 'Thumb Media ID'),
            'show_cover_pic' => Yii::t('app', 'Show Cover Pic'),
            'url' => Yii::t('app', 'Url'),
            'thumb_url' => Yii::t('app', 'Thumb Url'),
            'need_open_comment' => Yii::t('app', 'Need Open Comment'),
            'only_fans_can_comment' => Yii::t('app', 'Only Fans Can Comment'),
            'create_time' => Yii::t('app', 'Create Time'),
            'update_time' => Yii::t('app', 'Update Time'),
        ];
    }

    /**
     * @inheritdoc
     * @return \backend\modules\wxsource\models\query\WxSourceQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \backend\modules\wxsource\models\query\WxSourceQuery(get_called_class());
    }
}
